#include "student.h"
#include <QDebug>

Student::Student(QObject *parent) : QObject(parent)
{

}

void Student::treat(){
    qDebug() << "请老师吃饭";

}

void Student::treat(QString foodName){
    //QString转 char *
    //.toUtf8转为QByteArray类型
    //通过QByteArray.data()转为char *

    //qDebug() << "请老师吃饭，老师要吃" << foodName;
    qDebug() << "请老师吃饭，老师要吃" << foodName.toUtf8().data();

}
